package element;


/**
 * Une cellule de la map
 * @author Fabien BINI & Nicolas POIRIER
 */
public class Cell implements Cloneable
{
	/**
	 * Les types de cellule
	 */
	public static enum CellType
	{
		GRASS,
		TREE,
		ROCK,
		ASH, 
		SAND, 
		ROCKLAVA
	};
	
	private int height;
	private CellType type;
	private State state;
	private int timerType;
	
	public Cell(int height, CellType type, State state)
	{
		this.height = height;
		this.type = type;
		this.state = state;
	}
	
	public Object clone()
	{
		return new Cell(this.height, this.type, (State)this.state.clone());
	}

	public CellType getType() 
	{
		return type;
	}
	
	public void setType(CellType type)
	{
		this.type = type;
		timerType = 0;
	}

	public void incrementTimer()
	{
		timerType++;
	}
	
	public int getTimerType()
	{
		return timerType;
	}

	public State getState() 
	{
		return state;
	}

	public void setState(State state) {
		this.state = state;
	}

	public int getHeight() 
	{
		return height;
	}

	public void setHeight(int height) 
	{
		this.height = height;
	}

}